/*
 * Utils.h
 *
 *  Created on: Jul 7, 2009
 *      Author: elkobir
 */

#ifndef UTILS_H_
#define UTILS_H_

#include <iostream>
#include <string>
#include <iomanip>
#include <fstream>
#include <vector>
#include <sstream>
#include "Log.h"
using namespace std;

class Utils {
public:
	Utils();
	virtual ~Utils();

	static char* StringToCharKohav(string str);
	static string CharKohavToString(char* charKohav);

	static int GetInt(unsigned char* pb,int start);

	static void IntToByte(int val, unsigned char* pBytes,int start);

	static void tokenize(const string& str, vector<string>& tokens, const string& delimiters);

	static unsigned char* InitBytes(int size);

	static vector<string>* tokPath(char* pathName);

	static vector<string>* tokPath(string pathName);

	static bool contains(string name, vector<string>* vec);

	//return inodeNumber of the matchin string, -1 if not found
	static int getInodeByName(string name, vector<pair<int,string> >* vec);

	static char* getLastName(vector<string>* vec);

	static bool removeName(string name, vector<pair<int,string> >* vec);

	static string pathFromTokens(vector<string>* vec);

	static string vectorToText(vector<string>* vec);

};



#endif /* UTILS_H_ */
